package util;

import util.date.DateUtil;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.logging.Level;
import java.util.logging.Logger;


//StringBuffer is synchronized, StringBuilder is not.
//http://stackoverflow.com/questions/355089/stringbuilder-and-stringbuffer-in-java

/**
 *
 * @author Rdelacruz
 */
public class TestDateUtil {
    
    public static void main(String args[]) {        
        try {
            test_parse1();
            //test_parse();
        } catch (ParseException ex) {
            Logger.getLogger(TestDateUtil.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
    
    public static void test_parse1() throws ParseException {       
        String tiempo12 = "10:30 PM";        
        System.out.println(tiempo12 + " = " + DateUtil.convertir12HorasTo24Horas(tiempo12));
        
        String tiempo24 = "23:15";                
        System.out.println(tiempo24 + " = '" + DateUtil.convertir24HorasTo12Horas(tiempo24,true)+"'");
        System.out.println(tiempo24 + " = '" + DateUtil.convertir24HorasTo12Horas(tiempo24,false)+"'");
        
        System.out.println(DateUtil.convertirVarios24HorasSeparadorPorComasTo12Horas("12,0",true));
                
        for(int h=0; h<=24; h++) {        
            System.out.print(DateUtil.convertir24HorasTo12Horas(h+":00",true)+" ");
        }
        
    }
    
    public static void test_parse() {
        SimpleDateFormat pf;
        pf = new SimpleDateFormat("hh:mm a");
    }
   
    
}
